
/*
* Copyright 2017-2018 pinganfang
* All right reserved.
*
*/
package com.pingan.haofang.searchcloud.index.domain;

import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * @author huhailiang937
 */
@Entity
@Table(name = "t_index")
@EntityListeners({AuditingEntityListener.class})
public class Index {

    /**
     * ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id")
    private Long id;

    /**
     * 项目 ID
     */
    @Column(name = "project_id")
    private Long projectId;

    /**
     * 索引名称，最大长度64
     */
    @Column(name = "index_name")
    private String indexName;

    /**
     * 索引别名，最大长度64
     */
    @Column(name = "index_alias_name")
    private String indexAliasName;

    /**
     * 引擎 0：SOLR  1：ES
     */
    @Column(name = "engine_type")
    private Integer engineType;

    /**
     * 状态 0：正常 1：停用
     */
    @Column(name = "status")
    private Integer status;

    /**
     * 索引简介
     */
    @Column(name = "introduction")
    private String introduction;

    /**
     * 创建人
     */
    @Column(name = "create_by")
    @CreatedBy
    private Long createBy;

    /**
     * 最后修改人
     */
    @Column(name = "update_by")
    @LastModifiedBy
    private Long updateBy;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    @CreatedDate
    private Date createTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getProjectId() {
        return projectId;
    }

    public void setProjectId(Long projectId) {
        this.projectId = projectId;
    }

    public String getIndexName() {
        return indexName;
    }

    public void setIndexName(String indexName) {
        this.indexName = indexName;
    }

    public String getIndexAliasName() {
        return indexAliasName;
    }

    public void setIndexAliasName(String indexAliasName) {
        this.indexAliasName = indexAliasName;
    }

    public Integer getEngineType() {
        return engineType;
    }

    public void setEngineType(Integer engineType) {
        this.engineType = engineType;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getIntroduction() {
        return introduction;
    }

    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }

    public Long getCreateBy() {
        return createBy;
    }

    public void setCreateBy(Long createBy) {
        this.createBy = createBy;
    }

    public Long getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(Long updateBy) {
        this.updateBy = updateBy;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return "Index{" +
                "id=" + id +
                ", projectId=" + projectId +
                ", indexName='" + indexName + '\'' +
                ", indexAliasName='" + indexAliasName + '\'' +
                ", engineType=" + engineType +
                ", status=" + status +
                ", introduction='" + introduction + '\'' +
                ", createBy=" + createBy +
                ", updateBy=" + updateBy +
                ", createTime=" + createTime +
                '}';
    }
}
